Skip to content

Conversation

@aelovikov-intel
Copy link
Contributor

Before this PR our approach was to have
sycl_symbols_[linux|windows]-sycl.dump files in trunk that always capture the current state of symbols exported from libsycl.so/sycl.dll We highlighted added/removed symbols separately and considered "added" symbols as being OK while "removed" meant an ABI break. That works fine by is a bit too verbose. Also, not all "removed" are bad. If we've just added a symbol in a previous commit and are reverting it now, the backward ABI compatibility against the last release isn't being broken.

I don't think we promise any backward compatibility between arbitrary builds in the trunk (origin/sycl), only the compatibility against previous official minor releases with the same major version.

This PR adds two more tests that track what we promise better. I've modified our sycl/tools/abi_check.py to allow ignoring "added" symbols and only check against symbols that are being removed. I've also copied sycl_symbols*.dump from the sycl-rel-6_3 branch into the trunk under sycl_symbols*-sycl-rel-6_3.dump names and started running the testing for them in that new mode. Those must never fail, unless we're incrementing the major version or the break is intentional and approved (hence dedicated CODEOWNERS who can approve such changes).

I'm also adding a step to the sycl-nightly.yml workflow to ensure that those copies in trunk match the release branch. That would be handy if we were to cherry-pick some changes that add new symbols to the ongoing release.

Before this PR our approach was to have
`sycl_symbols_[linux|windows]-sycl.dump` files in trunk that always
capture the current state of symbols exported from
`libsycl.so`/`sycl.dll` We highlighted added/removed symbols separately
and considered "added" symbols as being OK while "removed" meant an ABI
break. That works fine by is a bit too verbose. Also, not all "removed"
are bad. If we've just added a symbol in a previous commit and are
reverting it now, the backward ABI compatibility against the last
release isn't being broken.

I don't think we promise any backward compatibility between arbitrary
builds in the trunk (`origin/sycl`), only the compatibility against
previous official minor releases with the same major version.

This PR adds two more tests that track what we promise better. I've
modified our `sycl/tools/abi_check.py` to allow ignoring "added" symbols
and only check against symbols that are being removed. I've also copied
`sycl_symbols*.dump` from the `sycl-rel-6_3` branch into the trunk under
`sycl_symbols*-sycl-rel-6_3.dump` names and started running the testing
for them in that new mode. Those **must** never fail, unless we're
incrementing the major version or the break is intentional and
approved (hence dedicated `CODEOWNERS` who can approve such changes).

I'm also adding a step to the `sycl-nightly.yml` workflow to ensure that
those copies in trunk match the release branch. That would be handy if
we were to cherry-pick some changes that add new symbols to the ongoing
release.
Comment on lines 11 to 24
check_abi_symbols:
name: Check ABI symbols tests match release branch
runs-on: [Linux, build]
if: github.repository == 'intel/llvm'
container: ghcr.io/intel/llvm/ubuntu2404_build
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
sycl/test/abi
- run: |
git fetch origin sycl-rel-6_3
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-6_3.dump
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-6_3.dump
Copy link
Contributor Author

@aelovikov-intel aelovikov-intel Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aelovikov-intel
Copy link
Contributor Author

aelovikov-intel commented Aug 22, 2025

Technically, we could remove old "trunk" tests and only use the new ones and reduce the noise. I'm not doing it here for the following reasons:

  • Live with both new/old approaches in parallel to get more confidence with the new one.
  • Seeing "added" symbols might still be beneficial, e.g. to catch cases when the addition was unintentional.
  • We'll need full up-to-date symbols in the future release branches. The easiest way to achieve that is to require trunk to always have them.

Comment on lines 22 to 24
git fetch origin sycl-rel-6_3
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-6_3.dump
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-6_3.dump
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Instead of hardcoding the release version (6.3), can we like have a variable: Something like:

LAST_SYCL_REL_VER="6_3"
git fetch origin sycl-rel-$LAST_SYCL_REL_VER
git diff --exit-code -I "^# RUN" origin/sycl-rel-$LAST_SYCL_REL_VER:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-$LAST_SYCL_REL_VER.dump
git diff --exit-code -I "^# RUN" origin/sycl-rel-$LAST_SYCL_REL_VER:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-$LAST_SYCL_REL_VER.dump

It would make it easier to update the release version for future releases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to leave it to the next update. Not exactly sure how it's going to look like. The code-duplication is isolated, and we can remove it if it starts to grow.

Copy link
Contributor

@uditagarwal97 uditagarwal97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aelovikov-intel aelovikov-intel merged commit d6eb331 into sycl Aug 25, 2025
51 of 63 checks passed
@aelovikov-intel aelovikov-intel deleted the rel-abi-symbols branch August 25, 2025 18:37
@AlexeySachkov
Copy link
Contributor

I don't think we promise any backward compatibility between arbitrary builds in the trunk (origin/sycl), only the compatibility against previous official minor releases with the same major version.

I think that strictly speaking, we do. Otherwise we wouldn't have ABI-breaking windows which are only 3-4 weeks long and would allow breaking ABI during a whole period between latest non-ABI-breaking release X and the upcoming ABI-breaking release X+1

@steffenlarsen
Copy link
Contributor

I think that strictly speaking, we do. Otherwise we wouldn't have ABI-breaking windows which are only 3-4 weeks long and would allow breaking ABI during a whole period between latest non-ABI-breaking release X and the upcoming ABI-breaking release X+1

Historically, we've allowed breaks within a short window of the corresponding symbols being introduced, but it is a little bit of a gray area.

@vinser52
Copy link
Contributor

I don't think we promise any backward compatibility between arbitrary builds in the trunk (origin/sycl), only the compatibility against previous official minor releases with the same major version.

I think that strictly speaking, we do. Otherwise we wouldn't have ABI-breaking windows which are only 3-4 weeks long and would allow breaking ABI during a whole period between latest non-ABI-breaking release X and the upcoming ABI-breaking release X+1

What if we need to roll back some commit that introduces a new ABI?

@AlexeySachkov
Copy link
Contributor

AlexeySachkov commented Aug 26, 2025

I don't think we promise any backward compatibility between arbitrary builds in the trunk (origin/sycl), only the compatibility against previous official minor releases with the same major version.

I think that strictly speaking, we do. Otherwise we wouldn't have ABI-breaking windows which are only 3-4 weeks long and would allow breaking ABI during a whole period between latest non-ABI-breaking release X and the upcoming ABI-breaking release X+1

What if we need to roll back some commit that introduces a new ABI?

That is what @steffenlarsen has been referring to as "gray area". I guess the question here is how short the window for a "hotfix" is.

For example, if it all happened within a day, then likely absolutely no one has seen it. If it happened within a few days, then it may already disrupt someone's workflow.

For the record: I'm not trying to say that we shouldn't do "hotfix" ABI-breaks (like reverting accidentally added exported symbol or something) if that is done quickly. But I still do think that we care about preserving ABI between arbitrary builds in the trunk (origin/sycl) when we talk about weeks scale. Those ABI-breaking windows were specifically introduced to limit the time period when ABI is unstable to avoid disruptions in internal testing.

@aelovikov-intel
Copy link
Contributor Author

Those ABI-breaking windows were specifically introduced to limit the time period when ABI is unstable to avoid disruptions in internal testing.

Those windows are about breaking ABI compatibility with the latest official release though, so I'm not sure how applicable that is.

But I still do think that we care about preserving ABI between arbitrary builds in the trunk (origin/sycl) when we talk about weeks scale.

Why? How would it be different for the user if the "break" is because something from yesterday is being reverted/"broken" vs something from a few weeks ago?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants